/* Global */
#org-chart {
  margin: 4rem;
}
#org-chart-toggle-all,
#org-chart-print {
  background-color: rgb(var(--color-heading));
  color: white;
  border: var(--org-chart-border-thickness) solid rgb(var(--color-heading));
  border-radius: calc((var(--org-chart-pill-height) / 4) + var(--org-chart-border-thickness));
  height: calc(var(--org-chart-pill-height) / 2);
  padding: calc(var(--org-chart-pill-height) / 4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
  margin-bottom: 1rem;
  text-decoration: none;
}
#org-chart-toggle-all:hover,
#org-chart-toggle-all:focus-visible,
#org-chart-print:hover,
#org-chart-print:focus-visible {
  background-color: white;
  color: rgb(var(--color-heading));
}
#org-chart>ul,
#org-chart>ul>li,
#org-chart>ul>li>ul,
#org-chart>ul>li>ul>li,
#org-chart>ul>li>ul>li>ul,
#org-chart>ul>li>ul>li>ul>li,
#org-chart>ul>li>ul>li>ul>li>ul,
#org-chart>ul>li>ul>li>ul>li>ul>li,
#org-chart>ul>li>ul>li>ul>li>ul>li>ul,
#org-chart>ul>li>ul>li>ul>li>ul>li>ul>li {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  justify-items: stretch;
  align-items: start;
  gap: 1rem;
  position: relative;
  width: 100%;
}

#org-chart {
  --org-chart-text-color: white;
  --org-chart-line-color: #16214a;
  --org-chart-border-thickness: 5px;
  --org-chart-pill-height: 4rem;
}

#org-chart li>div {
  background: var(--org-chart-background-color);
  display: flex;
  border-radius: calc((var(--org-chart-pill-height) / 2) + var(--org-chart-border-thickness));
  border: var(--org-chart-border-thickness) solid var(--org-chart-background-color);
  overflow: clip;
  width: 100%;
  max-width: 100%;
  gap: 0.25rem;
  position: relative;
  z-index: 1;
}

#org-chart li>div>img {
  object-fit: cover;
  object-position: top center;
  border-radius: 50%;
  width: var(--org-chart-pill-height);
  height: var(--org-chart-pill-height);
  flex-shrink: 0;
}

#org-chart li>div>.org-chart-dept-link,
#org-chart li>div>button {
  border: none;
  outline: none;
  color: var(--org-chart-text-color);
  background: transparent;
  width: calc(var(--org-chart-pill-height) / 2);
  height: var(--org-chart-pill-height);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

#org-chart li>div>a:hover,
#org-chart li>div>a:focus-visible,
#org-chart li>div>.org-chart-dept-link:hover,
#org-chart li>div>.org-chart-dept-link:focus-visible,
#org-chart li>div>button:hover,
#org-chart li>div>button:focus-visible {
  background: var(--org-chart-text-color);
  color: var(--org-chart-background-color);
}

#org-chart li>div>button::after,
#org-chart li>div>.org-chart-dept-link::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--org-chart-pill-height);
}

#org-chart li>div>button[aria-expanded=true]>i.fa-chevron-right::before {
  content: "";
}

#org-chart li>div>a {
  color: var(--org-chart-text-color);
  display: flex;
  flex-direction: column;
  text-decoration: none;
}

#org-chart li>div>div {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

#org-chart li>div>div>.org-chart-title {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: start;
  height: var(--org-chart-pill-height);
}

#org-chart li>div>a>.org-chart-title {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: start;
  height: calc(var(--org-chart-pill-height) / 2);
  border-bottom: var(--org-chart-border-thickness) solid var(--org-chart-background-color);
}

#org-chart li>div>div>.collapse {
  border-top: var(--org-chart-border-thickness) solid var(--org-chart-background-color);
  margin-left: calc(-1 * var(--org-chart-pill-height) - 0.25rem);
  margin-right: calc(-0.5 * var(--org-chart-pill-height) - 0.25rem);
  width: calc(100% + (1.5 * var(--org-chart-pill-height)) + 0.5rem);
  background-color: white;
  max-width: none;
  padding: 0;
  font-size: 1rem;
}

#org-chart li>div>div>.collapsing {
  -webkit-transition: none;
  transition: none;
  display: none;
}

#org-chart li>div>div>.collapse ul {
  list-style-type: disc;
  padding: 0;
  margin: 0;
  padding-left: 2em;
}

#org-chart li>div>div>.collapse li::marker {
  color: var(--org-chart-background-color);
}

#org-chart li>div>div>.collapse li,
#org-chart li>div>div>.collapse p {
  padding: 0 0.25rem;
  margin: 0.25rem 0;
}

#org-chart li>div>div>.collapse ul {
  border: 2px solid var(--org-chart-background-color);
  border-left: none;
  border-right: none;
}

#org-chart li>div>div>.collapse .org-chart-dept-link {
  color: var(--org-chart-background-color);
  display: block;
  padding: 0.25rem;
  text-align: center;
}

#org-chart li>div>div>.collapse .org-chart-dept-link::after {
  text-align: center;
  font-weight: 900;
  content: "";
  font-variant: normal;
  text-rendering: auto;
  font-style: normal;
  line-height: 1;
  font-family: "Font Awesome 6 Pro";
}

#org-chart li>div>div>.collapse .org-chart-dept-link:hover,
#org-chart li>div>div>.collapse .org-chart-dept-link:focus-visible {
  background: var(--org-chart-background-color);
  color: var(--org-chart-text-color);
}

#org-chart li>div>div>.collapse ul:fist-child>li:first-child {
  border-top-thickness: 0px;
}

#org-chart li>div>a>img {
  width: 100%;
}

#org-chart li>div h2,
#org-chart li>div h3,
#org-chart li>div h4,
#org-chart li>div h5,
#org-chart li>div h6,
#org-chart li>div .org-chart-subtitle {
  color: var(--org-chart-text-color);
  margin: 0;
  font-size: 1.25rem;
  line-height: 1;
  font-family: proxima-nova-extra-condensed;
}

#org-chart li>div h2 {
  color: inherit;
  text-align: center;
  align-self: center;
}

#org-chart li>div .org-chart-subtitle {
  font-size: 1rem;
}

/* Level 2 */

/* Level 3 */

/* Level 4 and 5 */
#org-chart>ul>li>ul>li>ul>li>ul>li::before,
#org-chart>ul>li>ul>li>ul>li>ul>li>ul>li::before {
  content: "";
  position: absolute;
  left: -0.5rem;
  top: calc((var(--org-chart-pill-height) + var(--org-chart-border-thickness)) / 2);
  width: 1rem;
  border-bottom: var(--org-chart-border-thickness) solid var(--org-chart-line-color);
}

#org-chart>ul>li>ul>li>ul>li>ul>li::after,
#org-chart>ul>li>ul>li>ul>li>ul>li>ul>li::after {
  content: "";
  position: absolute;
  left: calc(-0.5rem - var(--org-chart-border-thickness));
  top: calc(-1.5rem);
  height: calc(100% + 1.5rem);
  border-left: var(--org-chart-border-thickness) solid var(--org-chart-line-color);
}

#org-chart>ul>li>ul>li>ul>li>ul>li:last-child::after,
#org-chart>ul>li>ul>li>ul>li>ul>li>ul>li:last-child::after {
  height: calc(1.5rem + var(--org-chart-border-thickness) + ((var(--org-chart-pill-height) + var(--org-chart-border-thickness)) / 2));
}

#org-chart>ul>li>ul>li>ul>li>ul>li,
#org-chart>ul>li>ul>li>ul>li>ul>li>ul>li {
  margin-left: 2rem;
  width: calc(100% - 2rem);
}

/* List (below 1600px) */
@media screen and (max-width: 1200px) {
  #org-chart {
    margin: 2rem;
  }
  #org-chart>ul {
    margin: 0 auto;
    width: min(100%, 600px);
  }
  /* Level 2 and 3 */
  #org-chart>ul>li>ul>li::before,
  #org-chart>ul>li>ul>li>ul>li::before {
    content: "";
    position: absolute;
    left: -0.5rem;
    top: calc((var(--org-chart-pill-height) + var(--org-chart-border-thickness)) / 2);
    width: 1rem;
    border-bottom: var(--org-chart-border-thickness) solid var(--org-chart-line-color);
  }

  #org-chart>ul>li>ul>li::after,
  #org-chart>ul>li>ul>li>ul>li::after {
    content: "";
    position: absolute;
    left: calc(-0.5rem - var(--org-chart-border-thickness));
    top: calc(-1.5rem);
    height: calc(100% + 1.5rem);
    border-left: var(--org-chart-border-thickness) solid var(--org-chart-line-color);
  }

  #org-chart>ul>li>ul>li:last-child::after,
  #org-chart>ul>li>ul>li>ul>li:last-child::after {
    height: calc(1.5rem + var(--org-chart-border-thickness) + ((var(--org-chart-pill-height) + var(--org-chart-border-thickness)) / 2));
  }

  #org-chart>ul>li>ul>li,
  #org-chart>ul>li>ul>li>ul>li {
    margin-left: 2rem;
    width: calc(100% - 2rem);
  }
}

/* Chart (Above 1601px) */
@media screen and (min-width: 1201px), print {
  /* Level 1 */
  #org-chart>ul>li>div {
    width: min(100%, 400px);
  }
  #org-chart>ul>li {
    justify-items: center;
  }

  /* Level 2 */
  #org-chart>ul>li>ul {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #org-chart>ul>li>ul>li {
    justify-items: center;
  }

  #org-chart>ul>li>ul>li>div {
    width: min(100%, 250px);
    margin: 1rem 0;
  }

  #org-chart>ul>li>ul>li:first-child>div {
    justify-self: right;
    transform: translateX(50%);
    z-index: 1
  }

  #org-chart>ul>li>ul>li:first-child::before {
    content: "";
    position: absolute;
    top: -1rem;
    right: calc(-1 * (var(--org-chart-border-thickness) / 2));
    height: calc(var(--org-chart-pill-height) + 3rem + var(--org-chart-border-thickness));
    border-left: var(--org-chart-border-thickness) solid var(--org-chart-line-color);
  }

  #org-chart>ul>li>ul>li:last-child::before {
    content: "";
    position: absolute;
    top: 0;
    right: calc(50% - (var(--org-chart-border-thickness) / 2));
    height: 1rem;
    border-left: var(--org-chart-border-thickness) solid var(--org-chart-line-color);
  }

  #org-chart>ul>li>ul>li:last-child::after {
    content: "";
    position: absolute;
    top: 0;
    left: calc(-3 * var(--org-chart-border-thickness));
    width: calc(50% + 3 * var(--org-chart-border-thickness));
    border-bottom: var(--org-chart-border-thickness) solid var(--org-chart-line-color);
  }

  /* Level 3 */
  #org-chart>ul>li>ul>li>ul {
    --org-chart-background-color: #75BF43;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    width: calc(200% + 1rem);
    justify-self: left;
    row-gap: 2rem; 
  }

  #org-chart>ul>li>ul>li>ul>li::before {
    content: "";
    position: absolute;
    top: -1rem;
    right: calc(50% - (var(--org-chart-border-thickness) / 2));
    height: 1rem;
    border-left: var(--org-chart-border-thickness) solid var(--org-chart-line-color);
  }

  #org-chart>ul>li>ul>li>ul>li::after {
    content: "";
    position: absolute;
    top: calc(-1rem - var(--org-chart-border-thickness));
    width: calc(100% + 1rem);
    border-bottom: var(--org-chart-border-thickness) solid var(--org-chart-line-color);
  }

  #org-chart>ul>li>ul>li>ul>li:first-child::after {
    left: calc(50% - (var(--org-chart-border-thickness) / 2));
    width: calc(50% + (var(--org-chart-border-thickness) / 2) + 1rem);
  }

  #org-chart>ul>li>ul>li>ul>li:last-child::after {
    right: calc(50% - (var(--org-chart-border-thickness) / 2));
    width: calc(50% + (var(--org-chart-border-thickness) / 2) + 1rem);
  }
}

/* List small margin (below 750px) */
@media screen and (max-width: 750px) {
  #org-chart {
    margin: 1rem;
  }
}

/* Print */
@media print {

  /* Larger Level 2's */
  #org-chart>ul>li>ul>li {
    --org-chart-pill-height: 6rem;
  }
  #org-chart h2,
  #org-chart h3 {
    font-size: 1.75rem;
    line-height: 1;
  }
  #org-chart>ul>li>ul>li>div .org-chart-subtitle {
    font-size: 1.25rem;
    line-height: 1;
  }
  #org-chart>ul>li>ul>li>ul>li {
    --org-chart-pill-height: 4rem;
  }

  /* General */
  @page {
    size: 2200px 1700px;
  }

  #org-chart {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    margin: 0;
    padding: 2rem;
    background-image: var(--print-bg);
    background-position: center;
    background-size: cover;
  }
  #org-chart h1 {
    font-size: 3.75rem;
    line-height: 1;
    position: absolute;
    top: 4rem;
    left: calc(200px + 8rem);
    width: calc(50% - 400px - 8rem);
    text-transform: uppercase;
  }
  #org-chart-seal {
    background-image: var(--print-seal);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    position: absolute;
    top: 4rem;
    left: 4rem;
    height: 250px;
    aspect-ratio: 1;
  }

  #org-chart-toggle-all,
  #org-chart-print,
  #org-chart .org-chart-dept-link,
  #org-chart li>div>button,
  #org-chart .fa-arrow-right-from-bracket {
    display: none !important;
  }


  #org-chart li>div>div>.collapse {
    display: block !important;
    margin-right: 0;
    width: calc(100% + var(--org-chart-pill-height) + 0.5rem);
  }

  #org-chart li>div>div>.collapse ul {
    border-bottom: none;
    column-count: 2;
    column-fill: balance;
  }
  #org-chart li>div>div>.collapse ul>li {
    break-inside: avoid-column;
  }
  html,
  body,
  body[style] {
    margin-left: 0 !important;
  }
  html,
  body,
  #org-chart {
    min-height: 100%;
    height: 100%;
  }
  #org-chart li>div>a:hover,
  #org-chart li>div>a:focus-visible,
  #org-chart li>div>.org-chart-dept-link:hover,
  #org-chart li>div>.org-chart-dept-link:focus-visible,
  #org-chart li>div>button:hover,
  #org-chart li>div>button:focus-visible {
    color: var(--org-chart-text-color);
    background: var(--org-chart-background-color);
  }
}